import Switch from './switch/switch.vue';
import Toast from './toast';
import Button from './button/button';
import Actions from './actions/actions';
import Loading from './loading';
import Message from './message';
import Card from './card';
const components = [
    Button,
    Switch,
    Actions,
    Card,
];
const install = function(Vue) {
    if (install.installed) return;
    components.forEach(component => {
        Vue.component(component.name, component);
    });
    Vue.use(Loading.directive);
    Vue.prototype.$loading = Loading.service;
    Vue.prototype.$toast = Toast;
    Vue.prototype.$message = Message;
}

// auto install
if (typeof window !== 'undefined' && window.Vue) {
    install(window.Vue);
}

export default {
    install,
    Button,
    Switch,
    Toast,
    Loading,
    Message,
    Card,
}
